import request from '@/util/request.js'
import {
	API_ROOT
} from '@/util/config.js'

// 首页banner
export function banners(data) {
	return request({
		url: `${API_ROOT}/lxm/banners/type/1`,
		method: 'get',
		data: data
	})
}

// 猫咪咨询
export function consultingService(data) {
	return request({
		url: `${API_ROOT}/lxm/banners/type/2`,
		method: 'get',
		data: data
	})
}

// 最新领养
export function lxmNew(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_new`,
		method: 'get',
		data: data
	})
}


// 详情页
export function lxmCatInfo(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_cat_info`,
		method: 'get',
		data: data
	})
}

// 领小猫列表
export function lxmPage(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_page`,
		method: 'get',
		data: data
	})
}

// 猫咪点赞接口 
export function lxmLike(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_like`,
		method: 'get',
		data: data
	})
}

// 猫咪评论接口 
export function lxmComment(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_comment`,
		method: 'get',
		data: data
	})
}

// 申请领养 
export function lxmAdopt(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_adopt`,
		method: 'post',
		data: data
	})
}

// 上传领养猫咪
export function lxmAddcat(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_addcat`,
		method: 'post',
		data: data
	})
}

// 获取用户openid
export function lxmLogin(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_login`,
		method: 'post',
		data: data
	})
}

// 获取用户信息
export function lxmAdduser(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_adduser`,
		method: 'post',
		data: data
	})
}


// 品种
export function lxmType(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_type`,
		method: 'post',
		data: data
	})
}


// 颜色
export function lxmColor(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_color`,
		method: 'post',
		data: data
	})
}

// 关于我们
export function lxmAboutus(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_aboutus`,
		method: 'post',
		data: data
	})
}

// 小程序码
export function lxmCode(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_code`,
		method: 'post',
		data: data
	})
}

// 小程序码--获取商品id
export function backCode(data) {
	return request({
		url: `${API_ROOT}/lxm/back_lxm_code`,
		method: 'post',
		data: data
	})
}

// 详情页收藏
export function lxmCollect(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_collect`,
		method: 'get',
		data: data
	})
}

/*
 page:/pages/my/my
 */
// 我的发布
export function myPost(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_mypost`,
		method: 'get',
		data: data
	})
}

// 我的收藏
export function myCollect(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_mycollect`,
		method: 'get',
		data: data
	})
}

// 我的领养
export function myAdopt(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_myadopt`,
		method: 'get',
		data: data
	})
}

// 下架猫咪
export function offCat(data) {
	return request({
		url: `${API_ROOT}/lxm/lxm_offcat`,
		method: 'get',
		data: data
	})
}

// 获取发布者用户信息
export function getInfo(data) {
	return request({
		url: `${API_ROOT}/lxm/x_get_info`,
		method: 'get',
		data: data
	})
}
